Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sagar_vij99
Creator
Creator

Unable to create Set Analysis

I have a table with fields with sample data P_Month P_Yr  Time Month_Name January  2018  40 January 2018 January  2018  30 January 2018 January  2018  40 January 2018 December  2017  10 December 2017 December  2017  40 December 2017 November 2017 20 November 2017 November 2017 60 November 2017 and i have created field using "MonthName(MakeDate(P_Yr, Month(Date#(P_Month,'MMMM'))))" as Month_Name in script. Now the problem is when i am calculating sum of time for current selected month and previous month using below set expression : =sum ({$}Time) When i am selecting only months from list box everything is working fine but as soon as i select 2018 from list box it shows me data for January 2018 but it does not show for December 2017. I tried to use Month_Name in set and tried below expression but it always shoes me 0 as value: =sum({$}Time) Can anyone please see what incorrect i am doing here. Any help will be appreciated..!! Regards Sagar

3 Replies
sunny_talwar

Would you be able to provide data which is formatted properly... I am not even sure what all fields you have and what information belongs to what field. If possible share a qvw sample

sagar_vij99
Creator
Creator
Author

Reposting my question:

I have a table with some fields with sample data and i have created field using "MonthName(MakeDate(P_Yr, Month(Date#(P_Month,'MMMM'))))" as Month_Name in script.

P_Month     P_Yr     Time     Month_Name

January     2018      40      January 2018

January     2018      30      January 2018

January     2018      40      January 2018

December    2017      10      December 2017

December    2017      40      December 2017

November    2017      20      November 2017

November    2017      60      November 2017

You can consider this as the sample data bcz i have huge data but somewhat similar.

Now the problem is i am calculating sum of time for current selected month and for previous month. For previous month i am using below set expression :

sum ({$<P_Month={"$(=Date(Addmonths(Month_Name,-1),'MMMM'))"}>}Time)

When i am selecting only months from list box everything is working fine but as soon as i select 2018 from list box(P_Yr) it shows me data for January 2018 but it does not show for December 2017.

I tried to use Month_Name in set and tried below expression but it always shoes me 0 as value:

sum({$<Month_Name={"$(=MonthName(Month_Name-1))"}>}Time)

Can anyone please see what incorrect i am doing here. Any help will be appreciated..!!

Regards

Sagar

sagar_vij99
Creator
Creator
Author

Hi Sunny, I have reposted my question. Some formatting issues came while posting question. Please see the question again.