Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

requirement

I have a requirement where I need to calculate sum(some field)

now I have two tables in my script(both having yearmonth flag),

sum(field) will be calculated when say yearmonth of table 1 is dec2017 den I need to take sum(field) where yearmonth in field2 shud be nov2017(I month befoe),

how I shud incorporate in set analysis

6 Replies
bramkn
Partner - Specialist
Partner - Specialist

Your question is a bit confusing to me.

You have 2 tables with the same data?

is this field yearmonth qualified for the table it is in? or do you have a kalendar?

Anonymous
Not applicable
Author

data is different in both tables

bramkn
Partner - Specialist
Partner - Specialist

so

sum({<yearmonthfield1={'dec2017'}>}field1)

sum({<yearmonthfield2={'nov2017'}>}field2)

?

Anonymous
Not applicable
Author

something like this:

sum({<yearmonth={'201712'},yearmonth2={'201711'}>}field)

PrashantSangle

How do you load it ??

when concatenate it are you creating any flag??

try like

sum({<flag={'Table 1'},yearMonth={"$(=max(yearMonth))"}>}field)-

sum({<flag={'Table 2'},yearMonth={"$(=AddMonths(max(yearMonth),-1))"}>}field)


Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
bramkn
Partner - Specialist
Partner - Specialist

with numbers you don't need the ''

if this is what you are looking for yes this should work. Without samples I can't help much more.