3 Replies Latest reply: Oct 5, 2018 6:03 AM by Juraj Misina

# Formula in qlik sense

Hello,

I need your helps to create a formula.

I have this table

day                               count_lgn         1_Day_back               2 Days_back               3 Days_back

10.05.2018                         100                        45                              88                              11

10.04.2018                         88                           11                             22                              65

Now let's assume that day is my column called 'DAY'

now in 1_Day back column I have to calculate the count(user_login) for 1_day_back means 10.04.2018 but just considering the user_login that are counted in 10.05.2018.

-->for the day 10.05.2018 my formula per 1_Day_back should count:

-->for the day 10.04.2018 my formula per 1_Day_back should count:

-->for the day 10.05.2018 my formula per 2_Day_back should count:

Thaks for any helps,

Best

• ###### Re: Formula in qlik sense

You can try your luck with the P() function in set analysis:

• ###### Re: Formula in qlik sense

I mean the frist part is fine, what you try to do with the second?

Thanks for any clarifications..

Best

• ###### Re: Formula in qlik sense

Hi Pasquale,

the second part selects only those user_logins which are associated with the Max(DAY) date (10.05.2018 in your example). So this should do exactly what you need it to do -> calculate logins for previous days, but only for those users who logged in on a selected day.

Hope this helps

Juraj