Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am pretty new to Nprinting and need someone's help.
I am using pixel perfect to create a report.
I have created a lot of calculated fields that I want to use in a table.
For instance, I have a formula for the number of days in january and a formula with the sales for january. Then I created a calculated field to calculate the sales/day.
For some reason, If I add into my table the 2 formulas and the calculated field. It works fine.
However, if I only show the calculated fields, it does not appear at all.
Can anyone please help? I am a bit stuck.
I also have a problem because whenever the result of a calculated field = 0, Nprinting report shows blank and not 0
The first problem is the most important one and any help would be highly appreciated.
Thank you.
Best regards.
Gerald
Well, I am not sure whats the problem?
Yes you need to use set analysis for each month, thats the workaround we know we have to take.
So to create what you have shown I would create an island dimension in my data model:
Load
Dual(Dim_txt,Dim_no) as Dim
;
Inline
[
Dim_no, Dim_txt
1, Sales
2, Cost
3, Margin
]
;
I would also create variables for my measures as in this case I can use variables with parameters:
Set vSales = Sum({<Month={$1}>}Sales);
Set vCost = Sum({<Month={$1}>}Cost);
Set vMargin = $(vSales($1))-$(vCost($1));
And after reload I would:
Pick(Dim,
$(vSales(1)),
$(vCost(1)),
$(vMargin(1))
)
Is that the approach you were thinking of?
Hello,
This a solution but at the moment, I ended up importing all converting the data into a stright table in qlik sense and then I imported all the cells from the table.
Hi,
What do you mean with "only show the calculated fields"? Could you post some screenshot of the template?
Are you using not supported objetcs https://help.qlik.com/en-US/nprinting/May2021/Content/NPrinting/ReportsDevelopment/Qlik-objects-supp...
As alternative you can create calculated fields in PixelPerfect reports https://help.qlik.com/en-US/nprinting/May2021/Content/NPrinting/PixelPerfectReports/Create-Calculate... or insert them as Formulas.
Best Regards,
Ruggero
Hello Ruggero,
No I am not using not suported objects. I know that objects such as pivot table are not supported as such (only as image). Thus, I created formulas and calculated fields in Nprinting.
In my example, I want to calculate the daily number of covers per month in a restaurant. In order to do so, I created a formula for my number of days in a specific month, another formula for my number of covers in that same month and finally a calculated field that divides the number of covers by the number of days.
The result I want for january is 528 which is the result of 10568/20
However, if I don't add 10568 and 20 in my table because I only want 528 in january, here is what's hapenning:
Thanks for your help.
Hi,
Are you refering to this feature?
If so, I think this is unfortunatelly "working as designed" and I believe for the calculated column to work in template the components used in calculation need to be also added to the template. They dont have to be visible, but must be added for calculation to work.
I am not a big fan of using such solution though as it is hard to maintain, has performance impact and it is difficult to debug. My suggestion would be to create dedicated object directly in Qlik Sense with all the required columns and use them as a source.
cheers
Hi,
I am indeed referring to the feature you are mentionning.
It is a lot of work but this is the only way to get the design I want with a table.
Here is an example of what I need to do:
January | February | march | … | |
Sales | ||||
Cost | ||||
Profit |
This is easily done with Qlik Sense via Pivot Table. Unfortunately, as far as I know, pivot table are not supported as object in Nprinting and can only be used as image which forces me to create a a table with 1 column per month and then to create 1 formula per month for sales and 1 formula for cost per month (through set analysis), and finally 1 calculated field per month for profit (sales-cost).
I haven't found any other way, I would gladly accept your guidance.
Thanks.
Best regards.
Gerald
Well, I am not sure whats the problem?
Yes you need to use set analysis for each month, thats the workaround we know we have to take.
So to create what you have shown I would create an island dimension in my data model:
Load
Dual(Dim_txt,Dim_no) as Dim
;
Inline
[
Dim_no, Dim_txt
1, Sales
2, Cost
3, Margin
]
;
I would also create variables for my measures as in this case I can use variables with parameters:
Set vSales = Sum({<Month={$1}>}Sales);
Set vCost = Sum({<Month={$1}>}Cost);
Set vMargin = $(vSales($1))-$(vCost($1));
And after reload I would:
Pick(Dim,
$(vSales(1)),
$(vCost(1)),
$(vMargin(1))
)
Is that the approach you were thinking of?
Hello,
This a solution but at the moment, I ended up importing all converting the data into a stright table in qlik sense and then I imported all the cells from the table.
That is exactly what you need to do with any NPrinting report (for your specific requirement) in which you need data that exist in a Pivot table....convert it to a straight table and use the straight table in your NP report. Its simply not possible to expand the individual columns/field data for use in your reports. To see this you can add your Pivot Table to and excel report and add straight table to the same excel report.
The pivot table cannot be expanded where as the straight table can. In turn then you can use the individual fields in any NP MS office, HTML and PxP (pixel perfect) report.
kind regards...