Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
mishraamit2485
Creator
Creator

Derive two months of data

Hi all in my app we have 6 months of data, (June July......Nov) i can derive quarter data(June July Aug) with that and show three months of data together, as I have quarter field in my dim table and I just do concat(Qtr Code) to get three months of data...I can also select individual months from a LB, not the requirement is to select two months of data at a time in a button(not in LB), if i select two data values in a Month list box i can see the combined data in my pivot, but i have to create a button to get two months of data.

1 Solution

Accepted Solutions
9 Replies
miguelbraga
Partner - Specialist III
Partner - Specialist III

Hi Amit,

I'm not sure I understood what is your problem. Can you please explain better what is your issue?

Regards,

MB

mishraamit2485
Creator
Creator
Author

Hi,

  My apologies for creating confusion.Let me try to explain again. I have a Month field and quarter in my database which is linked to my fact(primary key is month), now i'm showing quarter data(One button is there which shows qtr data) and monthly data(for each month i Have one button, now i want to show data for two months instead of quarte which month 1 and month 2  (e.g for month 1 sale is 100 and month 2 sale is 200) then when user clicks on button he should see 300...if i select two months in a listbox i'm getting the desired result..but how can i create a button where i wll pass two months and get the data.

For quarter i have one field in my dim table QTR i can use that but for two months I do not have anything like that.how to do that.

raman_rastogi
Partner - Creator III
Partner - Creator III

use this if you want for specific months

=sum({<month ={"june"},month ={"july"}>}Sale)

regards

raman

malini_qlikview
Creator II
Creator II

Hi,

you can try the below,

On click of the button, Set action for two variables to capture the Max and Min Month

say,  vMaxMonth=Max(MonthNo) and vMinMonth=Max(MonthNo)-1

Now in the expression use set analysis to pass these variable

Sum({<MonthNo={">=$(vMinMonth)<=$(vMaxMonth)"}>}Sales)

miguelbraga
Partner - Specialist III
Partner - Specialist III

mishraamit2485
Creator
Creator
Author

Not with list box that I can,  i want to create a button that should show the data what you will get when you select the same in a listbox.

mishraamit2485
Creator
Creator
Author

Its really helpful i needed that only, just one question will that work if I have dynamic values instead of static months i want to join two dynamic months....next month it will change, I can not hardcode it.

miguelbraga
Partner - Specialist III
Partner - Specialist III

I think you can do it by changing the current month and previous month to serve your needs

mishraamit2485
Creator
Creator
Author

Thanks a lot Miguel, you made my day