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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
GrowingBUG99
Contributor II
Contributor II

regarding Visualization

Hi community,

I want to create a bar graph for dimension Month(date)'&'-'&'Year(date) where it displays jan-24 and so on and measure includes count (process) , where for jan-24 it is 25 so on, for e.g i need total showing on the graph as jan 24 , feb 24 and march 24 and then the next bar should have its calculations showing as Q1 assuming which could be 65 in total then after wards apr-24 ,may 24 and jun- 24 then next bar Q2 assuming again could be 95 ....and so on till Q4. 

Thanx in advance

Labels (6)
2 Solutions

Accepted Solutions
JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @GrowingBUG99 

 

@marcus_sommer is correct. You need to use a As-Of-Table 

Here is a quick sample just for the quarters. 

JandreKillianRIC_0-1740662546134.png

DataTmp:
Load * Inline [
Date,Sales
45658,2671
45689,7994
45717,1510
45748,2940
45778,8531
45809,2538
45839,4016
45870,4594
45901,2836
45931,2036
45962,9599
45992,1320
46023,980
46054,5402
46082,7851
];

Data:
Load 
	Date(Date) as Date, 
    Month(Date) as Month, 
    Year(Date) as Year,
    Date(MonthStart(Date),'MMM YYYY') as MonthYear,
    Sales 
Resident DataTmp;

Drop Table DataTmp; 

TmpCal:
Load 
	Num(Min(Date)) as MinDate, 
    Num(Max(Date)) as MaxDate
Resident Data;

Let zMinDate = Peek('MinDate');
Let zMaxDate = Peek('MaxDate');

Drop Table TmpCal; 

Cal:
Load 
	($(zMinDate) + RecNo() - 1) as NewDate
AutoGenerate($(zMaxDate) - $(zMinDate)); 

AsOfTable:
Load
	Distinct
	Date(MonthStart(NewDate), 'MMM YYYY') as MonthYear,
    Date(MonthStart(NewDate), 'MMM YYYY') as AsOfMonth
Resident Cal;

Concatenate(AsOfTable) 
Load 
	'Q'&Ceil(Num(Month(NewDate))/3)&' - '&Year(NewDate) as AsOfMonth,
	Date(MonthStart(NewDate), 'MMM YYYY') as MonthYear
Resident Cal;


 

Regards Jandre

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn

View solution in original post

JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @GrowingBUG99 

Sort the As-Of-Month by Expression

=Max(Date) or =Max(MonthYear)

Regards Jandre

 

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn

View solution in original post

10 Replies
VBD
Partner - Creator II
Partner - Creator II

Hi,

if I understand correctly,you can try something like that in your measure : 

if(match(NumMonth,3,6,9,12),RangeSum( Above( Total Sum({1} Total_Price ), 0, 3))):

VBD_1-1740644616431.png

 

 

Regards

Valentin Billaud
Next Decision
GrowingBUG99
Contributor II
Contributor II
Author

yes the graph is correctly represented but for the expression it doesn't count for the whole process of Q1, ,Q2 and so on after year and month representation.

marcus_sommer

It's not possible with normal period-information from a calendar because a value could be only counted once against the dimension - as month or as quarter but not both at the same time.

To resolve such tasks you need an as-of-dimension which creates the needed n:m relation. More background to the matter is here provided:

The As-Of Table - Qlik Community - 1466130

JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @GrowingBUG99 

 

@marcus_sommer is correct. You need to use a As-Of-Table 

Here is a quick sample just for the quarters. 

JandreKillianRIC_0-1740662546134.png

DataTmp:
Load * Inline [
Date,Sales
45658,2671
45689,7994
45717,1510
45748,2940
45778,8531
45809,2538
45839,4016
45870,4594
45901,2836
45931,2036
45962,9599
45992,1320
46023,980
46054,5402
46082,7851
];

Data:
Load 
	Date(Date) as Date, 
    Month(Date) as Month, 
    Year(Date) as Year,
    Date(MonthStart(Date),'MMM YYYY') as MonthYear,
    Sales 
Resident DataTmp;

Drop Table DataTmp; 

TmpCal:
Load 
	Num(Min(Date)) as MinDate, 
    Num(Max(Date)) as MaxDate
Resident Data;

Let zMinDate = Peek('MinDate');
Let zMaxDate = Peek('MaxDate');

Drop Table TmpCal; 

Cal:
Load 
	($(zMinDate) + RecNo() - 1) as NewDate
AutoGenerate($(zMaxDate) - $(zMinDate)); 

AsOfTable:
Load
	Distinct
	Date(MonthStart(NewDate), 'MMM YYYY') as MonthYear,
    Date(MonthStart(NewDate), 'MMM YYYY') as AsOfMonth
Resident Cal;

Concatenate(AsOfTable) 
Load 
	'Q'&Ceil(Num(Month(NewDate))/3)&' - '&Year(NewDate) as AsOfMonth,
	Date(MonthStart(NewDate), 'MMM YYYY') as MonthYear
Resident Cal;


 

Regards Jandre

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn

diegozecchini
Specialist
Specialist

I would use an AsOfTable too, good idea

GrowingBUG99
Contributor II
Contributor II
Author

Thanxx everyone and also @marcus_sommer @JandreKillianRIC , this totally worked for me! 😄 

JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @GrowingBUG99 

Check out this link that @marcus_sommer shared. This gives a nice in depth overview of the as-of-month concept. 

Regards Jandre

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn

GrowingBUG99
Contributor II
Contributor II
Author

Sorry, asking for help again I have a question that might seem silly, but I wanted to ask anyway i was unable to solve the sorting part Q1 Q2 bar wont show after every month for e.g. jan-23 feb-23 mar-23 and Q1 and so on . hope u all dont mind

 

JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @GrowingBUG99 

Sort the As-Of-Month by Expression

=Max(Date) or =Max(MonthYear)

Regards Jandre

 

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn