Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Applicable88
Creator III
Creator III

Set Analysis not working because of single digit month

Hello, 

I'm using a set analysis to sum the sales of a table like this:

SalesYear1Month1
1234202101
2321202101
1231202101
32123202102
123123212021                03
1231232021                03
76765782021                04

It took me a while to find the problem, since it worked out last year. So I just realize when I finished that App it was from October on. And from October on, we have two digit Month i.e. 10-12

It works out without problem for my num(year(today())) part. But not for month:

Sum({1<Year1={"$(=num(year(today())))"},Month1={"$(=num(floor(month(today()))))"}>}[Sales]))

So when I now just put the  num(month(today())) in a KPI Window the number of today's month won't display as "01" but as "1".

So I guess for set analysis 01 is not the same as 1? 

I hope someone knows a workaround to this. 

Thanks.

 

 

1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

try this:

num(month(today()),'00')

View solution in original post

5 Replies
PrashantSangle

in your script just do below change

num#(Month1) as Month1

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Frank_Hartmann
Master II
Master II

try this:

num(month(today()),'00')

View solution in original post

Ksrinivasan
Specialist
Specialist

Hi,  are you sure,  was single digit month cause of problem? It happened to me also. But first two days or considered as date, 3rd and forth day was not considered as date. When two files were merged like CSV and XLS. It was formed like that. Pl. Confirm that whether single date not shown from single digit date.

Regards,

Ksrinivasan

Applicable88
Creator III
Creator III
Author

Thank you! That displayed the month as 01 and worked out. 

Applicable88
Creator III
Creator III
Author

thank you for your tip. It indeed was "one" of the problems. I really needed to make 01=1 work first, to filter the right sales data. But there was really also another mistake that I had to figured out.