Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello -
In Qlik Sense, I am trying to do a cross join.
I have a table with a set of constant values for each customer that I need to populate for all distinct dates within a table.
That table will be joined to another table that has dates. I have tried just bringing in the value, but if I have a date in my visualization the value shows as zero.
So I know if I had a table that had the constant values for each date, then it would join to the rest of my data, and return the values I desire.
So for example, the table with constant values looks like this.
In the load script editor, I want to do a cross join on periods 2022-07 - 2023-06, so that the result table looks like this.
I would greatly appreciate any help.
the script will be As below,
FactTable:
Datefield,Dim1,Dim2
From XyzSource;
Values:
Load * inline [
cust_num,value
1,0.74
2,0.69
];
Left Join(Values)
Load fieldvalue('Datefield',iterno()) as Datefield
Autogenerate(1)
While len(fieldvalue('Datefield',iterno()))>1;
the script will be As below,
FactTable:
Datefield,Dim1,Dim2
From XyzSource;
Values:
Load * inline [
cust_num,value
1,0.74
2,0.69
];
Left Join(Values)
Load fieldvalue('Datefield',iterno()) as Datefield
Autogenerate(1)
While len(fieldvalue('Datefield',iterno()))>1;
Thank you for helping me with this.I was able to incorporate the iterno function and got the result I needed.
You are a life saver!