Qlik Community

Ask a Question

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasdesai
Partner
Partner

Pivot table HTML code in Nprinting Nov 18

There is a requirement from the business user that he need a pivot table in the email body which is automated from Nprinting (Nov 18) 

Please note : I need pivot table code in HTML and don't want the image of the Qlik object in the email body.

Please help me with the solution .

 

Thanks and Regards

Vikas Desai

10 Replies
Lech_Miszkiewicz

great mate!

now:

  • provide us with version of software you are using + SR.
    • QlikView or Qlik Sense - which version?
    • NPrinting - which version (i see Nov 18, but i suggest to upgrade to April 2019)
  • screenshot of your pivot table in QlikView or Qlik Sense
  • screenshot of expected result
  • some additional info like:
    • since it is a pivot table is the number of columns dynamic?
    • if it is static maybe you could use straight table with set analysis an mimic pivot table behaviour
  • making html code for dynamic number of columns may not be possible - so do not get your hopes too high!!

 

once you give us above we maybe be able to give you some indication if what you are trying to do is achievable

looking forward to hear back from you

cheers

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Lech_Miszkiewicz

as a side note - we cannot use any js script as it will not be executed in email body anyway.. so this task becomes quite challenging
cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Ruggero_Piccoli
Employee
Employee

Hi @vikasdesai ,

I agree with @Lech_Miszkiewicz .

You could also try to:

  1. create the pivot table in the source document or app
  2. create the connection and generate the cache as usual
  3. add the pivot in the tables node of the HTML template
  4. embed the HTML report in the email body

All details about the steps are documented in the official help site.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
SanthoshkN
Contributor II
Contributor II

Hi @Ruggero_Piccoli , I had similar requirement and I had created HTML report as per the steps, but the HTML report doesn't give the same pivot structure as in Qlikview desktop rather gives as excel export format.

 

Can you suggest for having the exact  Pivot format in HTML email report.

 

Regards, SK

Lech_Miszkiewicz

Hi @SanthoshkN 

You need to do a lot more to get a pivot table look in HTML table as each of the rows in your html table would need to have dedicated inline formatting. There is no wizzard nor drag-drop solution. You need to code it in HTML and to be precise there is a lot of work to get it right.

How does your table need to look like? Sample of your pivot table would help to understand granularity of it, number of dimensions used etc.. Once we have sample, we may be able to mock something up and give you more accurate answer.

Thanks

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
SanthoshkN
Contributor II
Contributor II

Hi @Lech_Miszkiewicz ,

 

Thanks for your response. Can you please share any sample you have to present HTML report for 3 dimensions with one dimension is pivoted and the HTML report should be exactly as same as pivot table we get in Qlikview desktop.

Hope am clear on my requirement.

 

Regards, SK

Ruggero_Piccoli
Employee
Employee

Hi,

HTML still is HTML also in Qlik NPrinting so you have its limitations. In Qlik NPrinting you can develop report templates in HTML that uses HTML features but it doesn't add new features to the HTML. So you have to use standard HTML features to create the report that you want.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
Lech_Miszkiewicz

Hi @SanthoshkN 

Pivoted dimension would be very hard to do. I normally change it to straight table with set analysis mocking pivoted dimension

Then for dimension 1 & 2 I normally use row-span to create expression which i use in NPrinitng as a td tag in table which creates grouping on dimensional columns (see screenshot)

 

formula to create "pivot formula"column in Qlik app. This is very basic example to show you an idea on what can be achieved.

If(Dim1<>Above(Dim1),
'<td rowspan="'&RowSpanNo_1&'">'&Concat(DISTINCT Dim1)&'</td>
<td>'&Concat(DISTINCT Dim2)&'</td>
<td>'&exp_1&'</td>',
'<td>'&Concat(DISTINCT Dim2)&'</td>
<td>'&exp_1&'</td>')

 

screenshot:Capture.PNG

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Lech_Miszkiewicz

hi @SanthoshkN 

one more question...

Pivoted dimension (the one which creates columns), how many distinct values do you expect to see in it on average? 

I played little bit more with it and I think that i may have a solution for you as long as there is reasonable number of distinct values in pivoted dimension.

this is an example is result of what i came up with....I used QlikView but with Qlik Sense principles are the same

 

table no selections

Capture 2.PNG

result in nprinting

Capture.PNG

 

table selections applied

Capture 3.PNG

result in nprinting

Capture 4.PNG

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.